﻿Imports HtmlAgilityPack

Public Class frmMain

	Private Sub frmMain_Load(sender As Object, e As System.EventArgs) Handles Me.Load
		cmboLanguages.DataSource = GetLanguages()
		cmboLanguages.ValueMember = "Key"
		cmboLanguages.DisplayMember = "Value"

	End Sub

	Private Sub btnUpdateLanguages_Click(sender As Object, e As System.EventArgs) Handles btnUpdateLanguages.Click
		UpdateLanguages()
		cmboLanguages.DataSource = GetLanguages()
	End Sub

	Private Sub cmboLanguages_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles cmboLanguages.SelectedIndexChanged
		Dim URL As String = String.Format("http://wol.jw.org/{0}/", cmboLanguages.SelectedValue)
		Dim page As String = GetPage(URL, chkWorkOffline.Checked)
		browser1.DocumentText = page
	End Sub
End Class
